﻿<table class="adminContent">
    <tr>
        <td>

            <div id="average-order-report-grid"></div>
            <script>
                $(document).ready(function () {
                    $("#average-order-report-grid").kendoGrid({
                        dataSource: {
                            type: "json",
                            transport: {
                                read: {
                                    url: "@Html.Raw(Url.Action("OrderAverageReportList", "Order"))",
                                    type: "POST",
                                    dataType: "json"
                                }
                            },
                            schema: {
                                data: "Data",
                                total: "Total",
                                errors: "Errors"
                            },
                            error: function(e) {
                                display_kendoui_grid_error(e);
                                // Cancel the changes
                                this.cancelChanges();
                            },
                            serverPaging: true,
                            serverFiltering: true,
                            serverSorting: true
                        },
                        pageable: {
                            refresh: true,
                            numeric: false,
                            previousNext: false,
                            info: false
                        },
                        editable: {
                            confirmation: false,
                            mode: "inline"
                        },
                        scrollable: false,
                        columns: [{
                            field: "OrderStatus",
                            title: "@T("Admin.SalesReport.Average.OrderStatus")"
                        }, {
                            field: "SumTodayOrders",
                            title: "@T("Admin.SalesReport.Average.SumTodayOrders")"
                        }, {
                            field: "SumThisWeekOrders",
                            title: "@T("Admin.SalesReport.Average.SumThisWeekOrders")"
                        }, {
                            field: "SumThisMonthOrders",
                            title: "@T("Admin.SalesReport.Average.SumThisMonthOrders")"
                        }, {
                            field: "SumThisYearOrders",
                            title: "@T("Admin.SalesReport.Average.SumThisYearOrders")"
                        }, {
                            field: "SumAllTimeOrders",
                            title: "@T("Admin.SalesReport.Average.SumAllTimeOrders")"
                        }]
                    });
                });
            </script>
        </td>
    </tr>
</table>
